home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 September / PCWorld_2002-09_cd.bin / Akce / Quartet / Main / MAIN.SWF / scripts / DefineButton2_185 / BUTTONCONDACTION on(release).as < prev    next >
Text File  |  2002-08-07  |  1KB  |  52 lines

  1. on(release){
  2.    _root.SaveCurrentInteraction();
  3.    var sr = _root._arInteractions.getStudentResponse(_root.Q_objective_id);
  4.    var cr = _root._arInteractions.getCorrectResponse(_root.Q_objective_id);
  5.    var positive = true;
  6.    if(sr.length == cr.length)
  7.    {
  8.       var i = 0;
  9.       while(i <= cr.length - 1)
  10.       {
  11.          sr[i] = sr[i].toString(10);
  12.          if(_parent.Q_type == "DD-1")
  13.          {
  14.             var exist = false;
  15.             var cr_pom = cr[i].split(",");
  16.             var j = 0;
  17.             while(j <= cr_pom.length - 1)
  18.             {
  19.                if(cr_pom[j].toUpperCase() == sr[i])
  20.                {
  21.                   exist = true;
  22.                   break;
  23.                }
  24.                j++;
  25.             }
  26.             positive = positive && exist;
  27.          }
  28.          else if(sr[i].toUpperCase() == cr[i].toUpperCase())
  29.          {
  30.             positive = positive;
  31.          }
  32.          else
  33.          {
  34.             positive = positive && false;
  35.          }
  36.          i++;
  37.       }
  38.    }
  39.    else
  40.    {
  41.       positive = false;
  42.    }
  43.    if(positive)
  44.    {
  45.       _root.negative_positive.gotoAndStop("positive");
  46.    }
  47.    else
  48.    {
  49.       _root.negative_positive.gotoAndStop("negative");
  50.    }
  51. }
  52.